package com.qf.utils;

import org.apache.curator.RetryPolicy;
import org.apache.curator.framework.CuratorFramework;
import org.apache.curator.framework.CuratorFrameworkFactory;
import org.apache.curator.retry.ExponentialBackoffRetry;

/**
 * @author 千峰教育
 * @Company http://www.mobiletrain.org/
 * @Version 1.0
 */
public class ZkUtils {
    /**
     * 创建客户端
     * @return
     */
    public static CuratorFramework getClient(){
        RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 3);
//        CuratorFramework curatorFramework = CuratorFrameworkFactory.newClient(,3000,3000, retryPolicy);

        CuratorFramework curatorFramework =
                CuratorFrameworkFactory
                        .builder()
                        .connectString("192.168.200.146:2181")
                        .retryPolicy(retryPolicy)
                        .build();

        curatorFramework.
        start();
        return curatorFramework;

    }
}
